package com.zs.wl.springbootdemo.demos.Service.impl;

import com.zs.wl.springbootdemo.demos.Mapper.UserMapper;
import com.zs.wl.springbootdemo.demos.Service.UserService;
import com.zs.wl.springbootdemo.demos.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;



@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override

    @Cacheable(value="UserCache",key="'user.getAllUsers'")
    public List<User> getUsers() {

        return  userMapper.getUsers();
    }
}
